import Vue from "vue";
import Vuex from "vuex";
import mutations from "./mutation.js";
import getters from "./getter";

/* 日志 仅用于开发环境 start*/
// import createLogger from 'vuex/dist/logger'
import { createLogger } from 'vuex'
const debug = process.env.NODE_ENV !== 'production'
/* 日志 end */

Vue.use(Vuex);
//定义数据
var state={
    names:"name",
    age:"12",
    count:0,
    arr:[1,2,3]
};


var store=new Vuex.Store({
    state,
    mutations,
    getters,
    plugins: debug ? [createLogger()] : []

});


export default store;